<?php

namespace App\Enums\OpenShop\InvestmentPromotion;

use App\Service\OpenShop\Pdf\PdfMakerService;

class ShopManualEnum
{
    // 店长手册
    const TYPE_MANUAL = 1;
    // 夸父资质证明
    const TYPE_QUALIFICATION = 2;
    // 门店授权证书
    const TYPE_CERTIFICATE = 3;
    // 披露文件
    const TYPE_DISCLOSURE      = 4;
    const TYPE_DISCLOSURE_NAME = '披露文件';
    // 商户通费用城市分级
    const TYPE_CITY_TYPE = 5;
    // 特许经营信息披露函
    const TYPE_FRANCHISE_FILE = 6;
    // 门店运营手册
    const TYPE_MANUAL_SHOP_MANAGE = 7;
    // 产品标准SOP手册
    const TYPE_MANUAL_PRODUCT = 8;

    /**
     * 用户生成的文件列表
     */
    public static function getTypeFileList(): array
    {
        return [
            self::TYPE_MANUAL             => [
                'weight'  => PdfMakerService::getConfig('manager', 'weight'),
                'version' => PdfMakerService::getConfig('manager', 'version'),
                'name'    => PdfMakerService::getConfig('manager', 'name'),
                'func'    => [PdfMakerService::class, 'managerPdf']
            ],
            self::TYPE_MANUAL_SHOP_MANAGE => [
                'weight'  => PdfMakerService::getConfig('operation', 'weight'),
                'version' => PdfMakerService::getConfig('operation', 'version'),
                'name'    => PdfMakerService::getConfig('operation', 'name'),
                'func'    => [PdfMakerService::class, 'operationPdf']
            ],
            self::TYPE_MANUAL_PRODUCT     => [
                'weight'  => PdfMakerService::getConfig('sop', 'weight'),
                'version' => PdfMakerService::getConfig('sop', 'version'),
                'name'    => PdfMakerService::getConfig('sop', 'name'),
                'func'    => [PdfMakerService::class, 'sopPdf']
            ],
            self::TYPE_QUALIFICATION      => [
                'weight'  => PdfMakerService::getConfig('qualification', 'weight'),
                'version' => PdfMakerService::getConfig('qualification', 'version'),
                'name'    => PdfMakerService::getConfig('qualification', 'name'),
                'func'    => [PdfMakerService::class, 'qualificationPdf']
            ],
            self::TYPE_CITY_TYPE          => [
                'weight'  => PdfMakerService::getConfig('cityType', 'weight'),
                'version' => PdfMakerService::getConfig('cityType', 'version'),
                'name'    => PdfMakerService::getConfig('cityType', 'name'),
                'func'    => [PdfMakerService::class, 'cityTypePdf']
            ],
            self::TYPE_FRANCHISE_FILE     => [
                'weight'  => PdfMakerService::getConfig('franchise', 'weight'),
                'version' => PdfMakerService::getConfig('franchise', 'version'),
                'name'    => PdfMakerService::getConfig('franchise', 'name'),
                'func'    => [PdfMakerService::class, 'franchisePdf']
            ]
        ];
    }

}
